<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #app {
        width: 500px;
        height: 400px;
        background-color: goldenrod;
    }

    #div1 {
        width: 300px;
        height: 300px;
        background-color: rgb(32, 51, 218);
    }

    #div2 {
        width: 150px;
        height: 150px;
        background-color: rgb(231, 16, 177);
    }

    #div3 {
        width: 150px;
        height: 150px;
        background-color: rgb(231, 16, 45);
    }
</style>


<body>
    <div id="app" @click='yaya'>
        <div id="div1" @click.prevent='haha'>
            <div id="div2" @click.stop='lala'></div>
            <div id="div3" @click.self='nana'></div>
        </div>
        <a href="https://www.baidu.com" @click.prevent='tiao'>百度一下</a>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
        },
        methods: {
            haha() {
                console.log('点击div1')
            },
            lala() {
                console.log('点击div2');
            },
            yaya() {
                console.log('点击app');
            },
            nana() {
                console.log('点击div3');
            },
            tiao() {
                console.log('跳转百度')
            }
        }
    })
</script>

</html>